<template>
  <div>
    <el-container>
      <el-aside width="200px">
        <el-row class="tac">
          <el-col :span="12" id="left">
            <el-menu default-active="2" class="el-menu-vertical-demo">
              <el-menu-item index="3">
                <span slot="title">欢迎光临:&nbsp;{{ username }}</span>
              </el-menu-item>
              <el-menu-item index="1">
                <i class="el-icon-menu"></i>
                <span slot="title">首页</span>
              </el-menu-item>
              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-document"></i>
                  <span class="span">页面管理</span>
                </template>
                <el-menu-item-group>
                  <el-menu-item index="1-1" id="el" @click="myshop1"
                    >我的商铺</el-menu-item
                  >
                  <el-menu-item index="1-2" id="el" @click="myshop2"
                    >添加商铺</el-menu-item
                  >
                  <el-menu-item index="1-3" id="el" @click="myshop3"
                    >商铺管理</el-menu-item
                  >
                  <el-menu-item index="1-4" id="el" @click="myshop4"
                    >食品管理</el-menu-item
                  >
                  <el-menu-item index="1-5" id="el" @click="myshop5"
                    >订单管理</el-menu-item
                  >
                </el-menu-item-group>
              </el-submenu>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>
      <el-main>
        <el-breadcrumb separator="/">
          <el-breadcrumb-item :to="{ path: '/index' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item><a href="#">业务管理</a></el-breadcrumb-item>
          <el-breadcrumb-item>我的商铺</el-breadcrumb-item>
          <el-dropdown>
            <span class="el-dropdown-link">
              个人中心<i class="el-icon-arrow-down el-icon--right"></i>
            </span>
            <el-dropdown-menu slot="dropdown">
              <v-nav></v-nav>
            </el-dropdown-menu>
          </el-dropdown>
        </el-breadcrumb>
        <h3>商铺名称:</h3>
        <h3>{{shopname}}</h3>
        <h3>商铺地址:</h3>
        <h3>{{addr}}</h3>
        <h3>商铺电话:</h3>
        <h3>{{tel}}</h3>
        <h3>商铺图片:</h3>
        <h3><img :src="shoppic" alt=""></h3>
      
      </el-main>
    </el-container>
  </div>
</template>

<script>
//import nav from "../../components/nav.vue";
import addshopModel from "../../model/addshopModel.js";
export default {
  components: {
//  "v-nav": nav
  },
  data() {
    return {
      username: "",
      input: "",
      list:[],
      shopname:"",
      addr:"",
      tel:"",
      shoppic:""
    };
  },
  async created() {
    console.log(11);
    let info = window.localStorage.getItem("info");
    console.log(info);
    this.username = info;
    let result = await addshopModel.get();
    this.list=result
    let {data} =result;
    console.log(data);
    this.shopname=data.data[0].shopname
    this.addr=data.data[0].addr
    this.tel=data.data[0].tel
    this.shoppic=data.data[0].shoppic


  },
  methods: {
    addfood() {
      console.log(22);
    },
    myshop1() {
      this.$router.push("/shops/myshop");
    },
    myshop2() {
      this.$router.push("/shops/add");
    },
    myshop3() {
      this.$router.push("/shops/shop");
    },
    myshop4() {
      this.$router.push("/shops/food");
    },
    myshop5() {
      this.$router.push("/shops/order");
    }
  }
};
</script>

<style scoped>
h3 {
  padding: 10px;
}
</style>
